package com.google.code.j2ee.tdd;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.apache.commons.lang3.text.WordUtils;
import org.apache.commons.lang3.text.StrBuilder;
import org.apache.commons.lang3.StringUtils;



public class SymbolConverter {

	public  String toCamelCaseJoinedStrings(List<String> listOfStrings) {
		if(listOfStrings == null) { 
			throw new IllegalArgumentException("listOfStrings should not be Null");
		}
		StrBuilder result = new StrBuilder();
		Iterator<String> iterator = listOfStrings.iterator();
		while (iterator.hasNext()) {
			String currentValue = iterator.next();
			if((currentValue == null) || (currentValue.equalsIgnoreCase(""))) {  continue; }
			result.append(toCamelCase(currentValue));
		}
		return result.build();
	}

	public  String toCamelCase(String testString) {
		if(testString == null) { return null; }
		String IntermediateResult ;
		String result;
		IntermediateResult  = WordUtils.capitalize(testString.toLowerCase());
		result = StringUtils.deleteWhitespace(IntermediateResult);
		return result;
	}
	
	
	public static void main(String args[]){
		
		SymbolConverter symbolConverter = new SymbolConverter();
		List<String> lst = new LinkedList<String>();
		lst.add("-");
		lst.add("null");
		lst.add(null);
		lst.add("");
		lst.add(null);
		lst.add("fest festival My - jourent");
		String result = symbolConverter.toCamelCaseJoinedStrings(lst);
		System.out.println(result);

		List<String> lstNull = null;
		String result2 = symbolConverter.toCamelCaseJoinedStrings(lstNull);
		System.out.println(result2);
		
	}



}
